//
//  WBDemoViewController.swift
//  GitWeibo
//
//  Created by 胡金东 on 2017/5/22.
//  Copyright © 2017年 胡金东. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        title = "第\(navigationController?.childViewControllers.count ?? 0)个"

    }
    func rightBarClick()  {
        let demo = WBDemoViewController()
        navigationController?.pushViewController(demo, animated: true)
        
    }

  
}


extension WBDemoViewController{
    override func setUpTableView() {
   
        super.setUpTableView()
        
//        let btn = UIButton(type: .custom)
//        btn.setTitle("下一个", for: .normal)
//        /// - 要设置Frame 或者 btn.sizeToFit()自适应
////        btn.frame = CGRect(x: 0, y: 0, width: 64, height: 44)
//        btn.setTitleColor(UIColor.purple, for: .normal)
//        btn.setTitleColor(UIColor.orange, for: .highlighted)
//        btn.addTarget(self, action: #selector(rightBarClick), for: .touchUpInside)
//        btn.titleLabel?.font = UIFont.systemFont(ofSize: 15)
//        btn.sizeToFit()       
//        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn)
//        
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", titleColorNormal: UIColor.purple, titleColorHigh: UIColor.orange, target: self, action: #selector(rightBarClick))

    }
}
